<%-- 
    Document   : content
    Created on : Oct 26, 2010, 12:24:13 PM
    Author     : M Bilal
--%>

<%@page import="wap.rockvilletech.util.ParserBean"%>
<%@page import="wap.rockvilletech.portal.DBProc"%>
<%@ page import="java.io.*,java.sql.*,java.net.*"%>
<%@ page import="org.apache.log4j.Logger" %>
<% final Logger log = Logger.getLogger("JSP.COOLSTUFF.content.jsp");%>

<%@ include file="../includes/header.jspf"%>
<%
            thisPage = "Coolstuff-Content Price_2";
            String strStuffCat = "", str_item_id = "", strStuffid = "", str_arg0 = "", str_arg1 = "", text_content = "";
            boolean isQuotes = false, isLoveMatch = false;
            Vector vCoolStuff = null;

            tags = (request.getParameter("txtsrh") != null) ? request.getParameter("txtsrh").toString() : "";
            str_arg0 = (request.getParameter("arg0") != null) ? request.getParameter("arg0").toString() : "";
            str_arg1 = (request.getParameter("arg1") != null) ? request.getParameter("arg1").toString() : "";

            strStuffid = request.getParameter("stuff");
            str_item_id = request.getParameter("item");

            if (strStuffid == null) {
                strStuffid = "";
            }
            if (str_item_id == null) {
                str_item_id = "";
            }
            DBProc db = DBProc.getInstance();
            ParserBean pb = null;
            strStuffCat = wpb.coolStuffMapping(strStuffid);
            if ("Horoscope".equals(str_item_id)) {
                app = str_item_id + "-" + strStuffCat;
                vCoolStuff = (Vector) db.getHoroscope(strStuffid);
            } else if ("Love Quotes".equals(strStuffCat) || "Famous Quotes".equals(strStuffCat)) {
                app = strStuffCat;
                vCoolStuff = (Vector) db.getQuotes(strStuffid);
                isQuotes = true;
            } else if ("Love Horoscope".equals(str_item_id)) {
                app = str_item_id + "-" + strStuffCat;
                vCoolStuff = (Vector) db.getLoveHoroscope(strStuffCat);
            } else if ("Love Match".equals(strStuffCat)) {
                app = strStuffCat;
                isLoveMatch = true;
                pb = new ParserBean();
                text_content = pb.TarotDotComParser(str_arg0, str_arg1);
            } else {
                app = strStuffCat;
                vCoolStuff = (Vector) db.getCoolStuff(strStuffCat, str_item_id);
            }

%>

<div align="center">
<%if(!isODP){%>
    <div style="padding: 0px 0px 0px 0px;">
        <div class="div_navigation" id="div_navigation">
            <a href="<%=context_Path%>" class="LinkIndex">Home</a>&nbsp;&gt;
            <a href="<%=context_Path%>/coolstuff/index.jsp" class="LinkIndex">Coolstuff</a>&nbsp;&gt;
            <%
                        if ("Horoscope".equals(str_item_id)) {
            %>
            <a href="<%=context_Path%>/coolstuff/horoscope.jsp" class="LinkIndex">Horoscope</a>&nbsp;&gt;
            <%} else if ("Entertainment".equals(str_item_id)) {%>
            <a href="<%=context_Path%>/coolstuff/entertainment.jsp" class="LinkIndex">Entertainment</a>&nbsp;&gt;
            <%} else if ("Love Horoscope".equals(str_item_id)) {%>
            <a href="<%=context_Path%>/coolstuff/lv_horoscope.jsp" class="LinkIndex">Love Horoscope</a>&nbsp;&gt;
            <%} else if ("Love Match".equals(strStuffCat)) {%>
            <a href="<%=context_Path%>/coolstuff/love_match.jsp" class="LinkIndex">Love Match</a>&nbsp;&gt;
            <%}%>
            <span class="navigation_Leaf"><%=strStuffCat%></span>
        </div>
    </div>
<%}%>
    <table width="100%" align="left" cellpadding="0" cellspacing="0" style="text-align: left;font-weight: bold;">
        <tr>
            <td style="background-image:url('../images/new/top_bar_02.jpg');background-repeat: repeat-x;height:26px;">
                <b style="padding:0px 0px 0px 3px;"><%=strStuffCat%></b>
            </td>
        </tr>
    </table>
    <div style="clear:both;height:1px;">&nbsp;</div>

    <div style="padding:5px 0px 5px 5px;" align="left">
        <%
                    String strCoolStuff = "";
                    if (vCoolStuff != null && !vCoolStuff.isEmpty()) {//ContentData, ContentData_UR
                        String[] arr_coolstuff = null;
                        if (isQuotes) {
                            for (int c = 0; c < vCoolStuff.size(); c++) {
                                arr_coolstuff = (String[]) vCoolStuff.get(c);
                                strCoolStuff = arr_coolstuff[0];
                                out.println("<b>" + strCoolStuff + "</b> : " + arr_coolstuff[1] + "<br/><br/>");
                            }//end for
                        }
                        else if("Born Today".equals(strStuffCat))
                        {
                        	String time="";
                        	for (int c = 0; c < vCoolStuff.size(); c++) {
                        		arr_coolstuff = (String[]) vCoolStuff.get(c);
                        		if(c==0)
                        		{
                        			time=  arr_coolstuff[0];
                        			out.println("<b>"+time+"</b><br/>");
                        		}
                        		strCoolStuff = arr_coolstuff[1];
                                strCoolStuff = strCoolStuff.replaceAll("%0A", "<br/>");
                                out.println(strCoolStuff + "<br/>");
                            }
                        }
                        else {
                            for (int c = 0; c < vCoolStuff.size(); c++) {
                                arr_coolstuff = (String[]) vCoolStuff.get(c);
                                strCoolStuff = arr_coolstuff[0];
                                strCoolStuff = strCoolStuff.replaceAll("%0A", "<br/>");
                                out.println(strCoolStuff + "<br/>");
                            }//end for
                        }// end if quotes
                    } else if (isLoveMatch) {
                        out.println(text_content);
                    }
                    else {
                        out.println("No Data Available!");
                    }

        %>
    </div>
    <%
                if ("1".equals(strStuffid)) {
    %>
    <div style="padding:3px 3px 5px 0px;">
        <table cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <%
                    if (tags.length() > 0) {
                %>
                <td align="left"><a href="<%=request.getHeader("referer")%>"><< Back</a></td>
                <%}%>
                <td align="right"><a href="<%=context_Path%>/coolstuff/price_2.jsp?stuff=<%=strStuffid%>">Next >></a></td>
            </tr>
        </table>
    </div>
    <%
                }
      if(!isODP){
    %>
    <div style="text-decoration: underline;">
        <jsp:include page="../banner.jsp">
            <jsp:param name="w" value="<%=width%>"/>
        </jsp:include>
    </div>
</div>
    
<%@ include file="../includes/others.jspf"%>
<%}%>
<div align="center" style="padding: 5px 0px; font-size: 90%;">*Cool Stuff Charges Rs:2+tax</div>
<%@ include file="../includes/footer.jspf"%>
<%
wpb.persistContentCharging(str_item_id, strStuffid, "Collstuff", request.getQueryString(), "6211", strIP);
wpb.LogVisit(strIP, thisPage, strGsm, strApn, strBrand, strModel, app, request.getQueryString());
%>